EMT Practice Test

1. Question Content...


Question List

Question1: In the module located at app/code/MyCompany/MyModule there is a JS module in the file view/frontend/web/register.js. The Magento base URL is https://magento.host/ and the luma theme with the en_US locate is used.
What is the public URL for this file?

Question2: A custom module needs to log all calls of \Magento\Customer\Api\AddressRepositoryInterface::save().
Which mechanism do you use?

Question3: You are debugging a problem resulting from a recently deployed around plugin. The plugin is intercepting the doSomething method. The aroundDoSomething plugin method is called successfully, but the original doSomething method is no longer being executed as expected.
What is causing this?

Question4: You have added a new attribute origin of the type varchar to the product entity.
Which two calls will filter a product collection with origin set to "California"? (Choose two.)

Question5: You want to declare a block of the type \Magento\Framework\View\Element\Template with a template named view.phtml in the layout XML.
What is the correct layout declaration for this?

Question6: You added a new constructor argument to an existing action controller class.
When you reload the page you get a PHP error that the wrong argument is passed to the class.
How do you fix this?

Question7: A module you are developing requires the addition of new routes that should be accessible in the store front.
Where do you define your module's frontName?

Question8: Assume that $collection is a new instance of a class that extends
Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection, and $ids is an array of ids.
How do you select a list of records from the database where the record ids are in the $ids list?

Question9: Where do you change the frontName for the admin router?

Question10: A custom module must make changes to the schema following each setup:upgrade run. This must be done after all other module's schema updates have been applied.
How is this accomplished?

Question11: How many shipping addresses may be selected for an order during the checkout process?

Question12: A module you are developing requires the addition of new routes that should be accessible in the store front.
Where do you define your module's frontName?

Question13: A module declares the route:

What is the layout handle of the storefront path /custom/feature/?

Question14: How do you obtain customer information in a JavaScript module?

Question15: Your module, MyCompany_MyModule, is using the frontName mymodule. You need to locate the class responsible for the frontend path /mymodule/custom.
What file contains the controller class for the frontend path /mymodule/custom?

Question16: You have created a new block and will be adding this block on every page. The block contains user-specific information and cannot be cached. The block is added to the default.xml with:

What does this accomplish?

Question17: How do you persist an entity to the database?

Question18: You are working on a new entity called vendor. You implemented the model, resource model and collection. You want to ensure that standard model events will be fired for your model, so an observer can be created for the events vendor_save_after, vendor_save_commit_after and others.
How do you do that?

Question19: You are adding a new entry to the backend menu that appears after
Marketing > SEO & Search > Site Map
You see the existing site map menu item is declared by the node:

What two actions do you take to configure the new menu entry location? (Choose two.)

Question20: A module MyModule needs to send notifications to customers only when the account was modified from a mobile app using the REST web APIs.
You decided to implement an observer for customer_save_after_data_object event.
In which file do you declare the observer?

Question21: You are reviewing a Magento module and see a directory named Service.
What can you determine from this directory's name?

Question22: How does Magento store customer address attribute values?

Question23: The constructor function for \Magento\Catalog\Model\Category contains this excerpt:

With the automatic dependency injection that Magento provides, how is the StoreManagerInterface resolved?

Question24: You are creating a new page layout for your custom module.
What is the primary difference between container and block elements?

Question25: What is the relationship between products and categories in Magento?

Question26: Which two tasks are supported by Magento CLI? (Choose two.)

Question27: A merchant sells shoes with multiple variations such as a color and size. A shoe is represented by a configurable product. There are seven different colors and four sizes.
What is the minimal amount of simple products that represent a combination of color and size needs to be created in order to make a shoe salable?

Question28: The module MyCompany_MyModule will add a new page to the admin interface at the URL path admin/mycompany/entity_grid.
How do you name the file containing the action controller class so the admin router matches the path to the class?

Question29: While developing a module you need to modify an existing Data Patch.
How can you force Magento to execute an existing Data Patch file again?

Question30: In layout files you can change al element's order on a page. This can be done using one of the following:
<move> instruction
before and after element attributes?
How are two methods different?

Question31: A Magento industry partner shipping provider has tasked you to build their integration module called MyCompany_ShippingProvider.
Where do you define the class that provides options for the select field that enables or disables the provider in the file etc/adminhtml/system.xml?

Question32: You are implementing a custom module MyModule, which provides an implementation of \Psr\Log\LoggerInterface called \MyCompany\MyModule\Logger.
The LoggerInterface has the default preference declared in app/etc/di.xml.
Keeping upgradability in mind, how do you make \MyCompany\MyModule\Logger the default implementation of the LoggerInterface globally?

Question33: How do you set the custom block MyCompany\MyModule\Block\A as a child for the block named product.info using layout XML?

Question34: What are two functions of a resource model? (Choose two.)

Question35: You have been asked to display details from the customer's latest order on the customer's account dashboard (customer/account/). You create a new custom template to show the information.
How do you obtain an order repository so you can fetch an order?

Question36: A module you are working on needs to send a newsletter to all subscribed customers at predefined intervals.
Which two actions do you take to make sure the newsletter is sent? (Choose two.)

Question37: Which entity in Magento supports scoped attributes?

Question38: You have created a module with a custom ACL resource and want to restrict access to resources of your module.
Which three items are restricted based on ACL role permissions? (Choose three.)